-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GCOV not working for PHP-7.4 and master branches #4739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Please see https://externals.io/message/107113. |
So it looks there are two issues: generating coverage locally (this PR should fix that) and publishing the coverage which looks complicated and as yet undecided. |
6f86680
to
55fedd2
Compare
Code coverage reports (`make lcov`), since commit eef8522 (7.4 branch), generates incorrect coverage and emits warnings. Simplifying the Makefile.gcov file has the side-effect of resolving the issue. Processing sapi/cli/php_http_parser.gcda php-src/lcov_data/sapi/cli/php_http_parser.gcda:stamp mismatch with notes file geninfo: WARNING: gcov did not create any files for php-src/lcov_data/sapi/cli/php_http_parser.gcda! ... Processing ext/mbstring/mb_gpc.gcda php-src/lcov_data/ext/mbstring/mb_gpc.gcda:stamp mismatch with notes file geninfo: WARNING: gcov did not create any files for php-src/lcov_data/ext/mbstring/mb_gpc.gcda! Closes: https://bugs.php.net/bug.php?id=52718. See also: https://bugs.php.net/bug.php?id=78288.
Indeed. Thanks for change the PR message. |
I applied this patch and used
Which gives me a lot of warnings:
|
Okay, looks like this is gcov vs gcc version mismatch on my side. After running
the version warning goes away, but instead I get:
|
Based on linux-test-project/lcov#38 it looks like my lcov version is not compatible with GCC 8. After reconfiguring with
it works. As to the patch itself, I guess the disadvantage of this change is that now the ignored files will still be processed and only discarded afterwards. But that doesn't seem like much of a problem nowadays. |
Merged as 9cc1bf5 into 7.4. While at it, I've also added the Would you be interested in also looking into the Azure Pipelines integration, as mentioned in https://externals.io/message/107113? |
Sometimes warnings can be caused by missing libraries which need to added to the exclusion list. The version of gcov I've been testing against is:
gcov.php,net is using LCOV 1.10.
I couldn't find a way around that. It's probably still faster than the alternatives.
Nice. The coverage report is starting to look a lot less cluttered.
I'm looking into it. I'll follow up on the mailing list. |
* Add an Azure Publish Code Coverage Results task * Add `make gcovr-html` to generate a gcovr test coverage report in HTML * Add `make gcovr-xml` to generate a gcovr test coverage report in XML * Remove `test` target dependency from `make lcov-html`; Run the two targets together instead: `make test lcov-html`. Re: php#4739 (comment) See: https://externals.io/message/107113, https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops, and php#4759.
* Add an Azure Publish Code Coverage Results task * Add `make gcovr-html` to generate a gcovr test coverage report in HTML * Add `make gcovr-xml` to generate a gcovr test coverage report in XML * Remove `test` target dependency from `make lcov-html`; Run the two targets together instead: `make test lcov-html`. Re: php#4739 (comment) See: https://externals.io/message/107113, https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops, and php#4759.
* Add an Azure Publish Code Coverage Results task * Add `make gcovr-html` to generate a gcovr test coverage report in HTML * Add `make gcovr-xml` to generate a gcovr test coverage report in XML * Remove `test` target dependency from `make lcov-html`; Run the two targets together instead: `make test lcov-html`. Re: php#4739 (comment) See: https://externals.io/message/107113, https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops, and php#4759.
* Add an Azure Publish Code Coverage Results task * Add `make gcovr-html` to generate a gcovr test coverage report in HTML * Add `make gcovr-xml` to generate a gcovr test coverage report in XML * Remove `test` target dependency from `make lcov-html`; Run the two targets together instead: `make test lcov-html`. Re: php#4739 (comment) See: https://externals.io/message/107113, https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops, and php#4759.
* Add an Azure Publish Code Coverage Results task * Add `make gcovr-html` to generate a gcovr test coverage report in HTML * Add `make gcovr-xml` to generate a gcovr test coverage report in XML * Remove `test` target dependency from `make lcov-html`; Run the two targets together instead: `make test lcov-html`. Re: #4739 (comment) See: https://externals.io/message/107113, https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops, and #4759.
Code coverage reports (
make lcov
), since commit eef8522 (7.4 branch),generates incorrect coverage and emits warnings. Simplifying
the Makefile.gcov file has the side-effect of resolving the issue.
Closes: https://bugs.php.net/bug.php?id=52718.
See also: https://bugs.php.net/bug.php?id=78288.